<?php

namespace App\Providers;

use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\ServiceProvider;

class FilesystemServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        //
        $this->registerNativeFileSystem();
    }


    protected function registerNativeFileSystem(){
        $this->app->singleton('files',function (){
            //假如Filesystem需要传递参数，可以直接这里new ，并传参实例，不需要每次调用都传参
            return new Filesystem;
        });
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}
